﻿using PlayerRoles;
using PluginAPI.Core;


/// <summary>
/// 
/// </summary>
public class TeamUtils
{
    /// <summary>
    /// 获取 | 团队中文名称
    /// </summary>
    /// <param name="team"></param>
    /// <param name="output"></param>
    public static void GetTeamInfo(Team team, out string output)
    {
        switch (team)
        {
            case Team.SCPs:
                output = "<color=red>SCP</color>";
                break;
            case Team.Scientists:
            case Team.FoundationForces:
                output = "<color=blue>基金会</color>";
                break;
            case Team.ChaosInsurgency:
                output = "<color=green>混沌分裂者</color>";
                break;
            case Team.ClassD:
                output = "<color=orange>D级人员</color>";
                break;
            case Team.Dead:
                output = "<color=#DCDCDC>观察群体</color>";
                break;
            default:
                output = "<color=#FF00FF>未知势力</color>";
                break;
        }
    }

    /// <summary>
    /// 获取 | 刷新团队中文名称
    /// </summary>
    /// <param name="spawnableTeamType"></param>
    /// <param name="output"></param>
    public static void GetRespawnTeamInfo(Faction faction, out string output)
    {
        switch (faction)
        {
            case Faction.FoundationStaff:
                output = "<color=#BBFFFF>九尾狐特遣队</color>";
                break;
            case Faction.FoundationEnemy:
                output = "<color=#00FF00>混沌分裂者</color>";
                break;
            default:
                output = string.Empty;
                break;
        }
    }

    /// <summary>
    /// 获取 | 团队角色类型名称
    /// </summary>
    /// <param name="team"></param>
    /// <param name="roleTypeId"></param>
    /// <param name="output"></param>
    public static void GetDescription(Team team, RoleTypeId roleTypeId, out string output)
    {
        switch (team)
        {
            case Team.SCPs:
                output = $"<color=red>{roleTypeId}</color>";
                break;
            case Team.FoundationForces:
                output = $"<color=#01ABFF>{roleTypeId}</color>";
                break;
            case Team.ChaosInsurgency:
                output = $"<color=#01E436>{roleTypeId}</color>";
                break;
            case Team.Scientists:
                output = $"<color=#F7EE00>{roleTypeId}</color>";
                break;
            case Team.ClassD:
                output = $"<color=#F79D00>{roleTypeId}</color>";
                break;
            case Team.Dead:
                output = $"<color=#C100F7>{roleTypeId}</color>";
                break;
            case Team.OtherAlive:
                output = $"<color=#F70087>{roleTypeId}</color>";
                break;
            default:
                output = roleTypeId.ToString();
                break;
        }
    }

    /// <summary>
    /// 获取 | 团队成员数
    /// </summary>
    /// <param name="team"></param>
    /// <param name="count"></param>
    public static void GetTeamMembers(Team team, out int count)
    {
        count = Player.GetPlayers().FindAll(e => e.Team == team).Count;
    }
}